/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  dev
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#includeEtc "caseDicts/mesh/generation/snappyHexMeshDict.cfg"

castellatedMesh on;
snap            on;
addLayers       off;

geometry
{
    fixed
    {
        type triSurfaceMesh;
        file "fixed.obj";
    }
    rotating
    {
        type triSurfaceMesh;
        file "rotating.obj";
    }
    rotatingZone
    {
        type triSurfaceMesh;
        file "rotatingZone.obj";
    }
};

castellatedMeshControls
{
    features
    (
        { file "fixed.eMesh";        level 1; }
        { file "rotating.eMesh";     level 1; }
        { file "rotatingZone.eMesh"; level 1; }
    );

    refinementSurfaces
    {
        fixed
        {
            level       (2 2);
            patchInfo   { type wall; }
        }
        rotating
        {
            level       (2 2);
            patchInfo   { type wall; }
        }
        rotatingZone
        {
            level       (2 2);
            faceZone    rotatingZone;
            cellZone    rotatingZone;
            cellZoneInside  inside;
        }

    }

    refinementRegions
    {
        /*
        rotatingZone
        {
            mode inside;
            levels ((1E15 2));
        }
        */
    }

    locationInMesh (1e-5 1e-5 1e-5); // Offset from (0 0 0) to avoid
                                     // coinciding with face or edge
    nCellsBetweenLevels 3;
}

snapControls
{
    explicitFeatureSnap    true;
    implicitFeatureSnap    false;
}

addLayersControls
{
    layers
    {
        "(rotating|fixed)"
        {
            nSurfaceLayers 2;
        }
    }

    relativeSizes       true; // false, usually with firstLayerThickness
    expansionRatio      1.2;
    finalLayerThickness 0.5;
    minThickness        1e-3;
//  firstLayerThickness 0.01;

//  maxThicknessToMedialRatio 0.6;
}

writeFlags
(
//    scalarLevels
    layerSets
    layerFields
);

mergeTolerance 1e-6;

// ************************************************************************* //
